<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>故障诊断工具</title>
    <link rel="stylesheet" href="../css/main.min.css">
    <script src="../js/main.min.js"></script>
    <script src="../base/core.js"></script>
</head>
<body ng-app="myApp" ng-controller="diagnosisController">
<div class="container-fluid">
    <div class="row">
        <!--<div class="col-md-8">-->
            <!--<img src="fdj1.jpg" class="img-responsive img-rounded" />-->
        <!--</div>-->
        <button type="button" class="btn btn-primary" ng-model="timerState" uib-btn-checkbox btn-checkbox-true="1" btn-checkbox-false="0">
            {{timerState==0?"继续":"暂停"}}
        </button>
        <button type="button" class="btn btn-primary" ng-click="toLatest()">转到最新时间</button>
        <div class="col-md-12 pre-scrollable" style="max-height: 400px;min-height: 400px;">
            <uib-tabset active="mytab.active" type="tabs">
                <uib-tab index="0" heading="测点数据">
                    <div class="btn-group" ng-if="faultMatched!=null && faultMatched.length>0">
                        <label ng-repeat="f in faultMatched" ng-model="f.checked" class="btn" ng-class="{true : 'btn-danger',false : 'btn-danger' }[f.isMatched]" uib-btn-checkbox>
                            {{f.faultName}}
                        </label>
                    </div>
                    <table class="table table-responsive table-bordered">
                            <thead><tr>
                            <th>ID</th><th>信号类型</th><th>测量值</th>
                        </tr></thead>
                        <tbody>
                        <tr ng-repeat="signal in signals | filter:inCheckList track by $index">
                            <td>
                                {{$index+1}}
                            </td>
                            <td>
                                {{signal.portName}}
                            </td>
                            <td>
                                {{signal.value | startX:2}}
                            </td>
                        </tr>
                        </tbody>
                    </table>
                </uib-tab>
                <uib-tab index="1" heading="故障匹配">
                    <div class="btn-group">
                        <label class="btn btn-primary" ng-model="showUnknown" uib-btn-radio="false">只显示完全匹配的故障</label>
                        <label class="btn btn-primary" ng-model="showUnknown" uib-btn-radio="true">显示不完全匹配的故障</label>
                    </div>
                    <table class="table table-responsive table-bordered">
                        <thead><tr>
                            <th>故障名称</th><th>报告查看</th><th>诊断解释</th>
                        </tr></thead>
                        <tbody>
                        <tr ng-repeat="fault in faultMatched | filter:withUnknown" ng-class="{true : 'bg-danger',false : 'bg-gray' }[fault.isMatched]">
                            <td>{{fault.faultName}}</td>
                            <td>
                                <a ng-show="fault.isMatched" ng-click="showFaultReport(fault.id)">诊断报告</a>
                                <a ng-show="!fault.isMatched" ng-click="jumpToHuman(fault.id)">转到人工</a>
                            </td>
                            <td>
                                <a ng-click="showFaultTree(fault.id)">诊断解释</a>
                            </td>
                        </tr>
                        </tbody>
                    </table>
                </uib-tab>
            </uib-tabset>
        </div>
    </div>
</div>


<script src="faultDiagnosis.js"></script>
</body>
</html>